﻿using CommunityToolkit.Mvvm.ComponentModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WpfApp1.Services;

namespace WpfApp1.ViewModel
{
    public partial class MainViewModel: ObservableObject
    {
        [ObservableProperty]
        private string _name;
        private readonly ILoginUserService _loginService;
        public MainViewModel(ILoginUserService loginService)
        {
            _loginService = loginService;
            Test();
        }
        public  async void Test()
        {
            int i = 0;
            while (i < 10)
            {
                i++;
                var res = await _loginService.SendCode("12345678901");
                Console.WriteLine(res.Code);
                Name=DateTime.Now.ToString("yyyyMMddHHmmss");
                 await Task.Delay(1000);
            }


        }
    }
}
